package com.jtcoding.distributedlock.controller;

import com.jtcoding.distributedlock.model.Seckill;
import com.jtcoding.distributedlock.service.SeckillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author jason.tang
 * @Date 2020/01/24 09:47
 * @Desc
 */

@RestController
public class SeckillController {

    @Autowired
    private SeckillService seckillService;

    @GetMapping("/{seckillNum}")
    public Seckill seckillGoods(@PathVariable("seckillNum") Integer seckillNum) {
        return seckillService.double11GoodsSeckill(seckillNum);
    }
}
